<?php
include ("includes/myconnect.php");
    $sql = 'SELECT id,exchangeRate from tblcurrencyexchangerate2';
    $result = mysql_query($sql) or die(mysql_error());
    while ($row = mysql_fetch_assoc($result)) {
        $newvalue=$row['exchangeRate']+$row['exchangeRate']*$_POST['x']/100;
        $percent=1+ $_POST['x']/100;
        $sql = "update tblcurrencyexchangerate set `exchangeRate`='".$newvalue."' where id=".$row['id'] . " and currencyRootId <> currencyReferId ";
        //$sql = "update tblcurrencyexchangerate2 set `exchangeRate`='".$_POST['x']."' where id=".$row['id'];
        mysql_query($sql) or die(mysql_error());
    }
  echo "Successfully!";
?>
